The keyword 'Then' is expected after this If statement's condition Error

You neglected to type the 'Then' keyword after the Boolean condition in an If statement. To eliminate the possibility of this error, type Shift+Enter after typing

IF condition
REALbasic will then add the "Then" after the condition and then add the End If statement. Another shortcut is to write only the statements that meet the condition (inside the If...End if), select them, and then choose Wrap in If...End If from the Code Editor contextual menu.

This will surround your statements with IF condition Then above and End If below.


Example

If error=-123   //needs a 'Then' right here
   Beep
   MsgBox "Whoops! An error occured."
End If

See Also

If statement.